import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { ApiService } from '../core/api';
import { GB } from '../../environments/environment';

@Component({
  templateUrl: './orderDetail.html',
  styleUrls: ['./orderDetail.less']
})

export class OrderDetailComponent implements OnInit {

  del: any = {};
  active = 0;
  travelOrderId:string;
  gb = GB;
  constructor(
    private route: ActivatedRoute,
    private api: ApiService,
    private router: Router,
  ) {
    this.travelOrderId = this.route.snapshot.queryParams['travelOrderId'];
  }
  ngOnInit() {
    this.api.post('旅游订单详情', this.route.snapshot.queryParams).then((e:any) => {
      this.del = e.data;
      // this.del[''] =
      switch (this.del['status']) {
        case 'PREPARING':
		this.active = 3;
		break;
		case 'PAID':
		this.active = 1;
		break;
		case 'RECEIVED':
		this.active = 2;
		break;
      }
    });
  }
  showThis(i){
      if(this.active !== i){
          this.active = i;
      }
  }
}
